import pygame
import time
from settings import *

from board import Board

pygame.init()

screen = pygame.display.set_mode((WIDTH, HEIGHT))

screen.fill((164, 164, 164))

for i in range(9):
    pygame.draw.line(screen, (0, 0, 0), 
        (i * GRID_WIDTH + PADDING, PADDING),
        (i * GRID_WIDTH + PADDING, HEIGHT - PADDING))

for i in range(9):
    pygame.draw.line(screen, (0, 0, 0), 
        (PADDING, PADDING + i * GRID_HEIGHT),
        (WIDTH - PADDING, PADDING + i * GRID_HEIGHT))

board = Board()

board.draw(screen)
pygame.display.update()
    
going = True
while going:
    for evt in pygame.event.get():
        if evt.type == pygame.QUIT:
            going = False
        elif evt.type == pygame.MOUSEBUTTONDOWN:
            board.click(evt.pos)
            board.draw(screen)

    time.sleep(0.1)

